<?php 
require_once('../pdf/html2fpdf.php');

$adf = "hola";
$resto = " 
</h2>
<p>Este es el texto del ñárchivo pdf. Podemos incluir imagenes, enlaces, etc.</p>   
</body>   
</html> ";
$testo = 
"
<html>   
<head> 
<title>N</title>   
</head>   
<body>  
	<h1>Consulta</h1>
	<h2>
"; 

$nuevo='<html>
	<head>
    	<meta charset="utf-8"/>
		<style type="text/css">table{
	width:100%;
}</style>
    	<title>PDF Consulta</title>
		
	</head>
    <body>
    	<h1>Usuario: </h1>
        <h2>Consulta: </h2>
        <h3>Total: </h3>
        
        <table border="1" repeat_header=1>
            <thead>
                <tr>
                    <th>#</th>
                    <th>Número de equipo</th>
                    <th>Descripción</th>
                    <th>Número de Serie</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
				<tr>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                    <td>E</td>
                </tr>
            </tbody>
        </table>
    </body>
</html>';  
header('Content-type: application/pdf');
$pdf = new html2fpdf('P','mm','LETTER'); // Generamos un objeto nuevo html2fpdf   
$pdf -> AddPage(); // Añadimos una página   
//$pdf -> WriteHTML(utf8_decode($testo));// Indicamos la variable con el contenido que queremos incluir en el pdf  
//$pdf->Write(0,$adf);
//$pdf->Write(0,$adf);
//$pdf->WriteHTML(utf8_decode($resto));
$pdf->WriteHTML(utf8_decode($nuevo));
$pdf -> Output('Archivo.pdf','I'); //Generamos el archivo "archivo_pdf.pdf". Ponemos como parametro 'D' para forzar la descarga del archivo.   
?>